package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.MaintenancePlanMapper;
import com.ruoyi.system.domain.MaintenancePlan;
import com.ruoyi.system.service.IMaintenancePlanService;

/**
 * 维护计划Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-01-14
 */
@Service
public class MaintenancePlanServiceImpl implements IMaintenancePlanService 
{
    @Autowired
    private MaintenancePlanMapper maintenancePlanMapper;

    /**
     * 查询维护计划
     * 
     * @param deviceId 维护计划主键
     * @return 维护计划
     */
    @Override
    public MaintenancePlan selectMaintenancePlanByDeviceId(Long deviceId)
    {
        return maintenancePlanMapper.selectMaintenancePlanByDeviceId(deviceId);
    }

    /**
     * 查询维护计划列表
     * 
     * @param maintenancePlan 维护计划
     * @return 维护计划
     */
    @Override
    public List<MaintenancePlan> selectMaintenancePlanList(MaintenancePlan maintenancePlan)
    {
        return maintenancePlanMapper.selectMaintenancePlanList(maintenancePlan);
    }

    /**
     * 新增维护计划
     * 
     * @param maintenancePlan 维护计划
     * @return 结果
     */
    @Override
    public int insertMaintenancePlan(MaintenancePlan maintenancePlan)
    {
        return maintenancePlanMapper.insertMaintenancePlan(maintenancePlan);
    }

    /**
     * 修改维护计划
     * 
     * @param maintenancePlan 维护计划
     * @return 结果
     */
    @Override
    public int updateMaintenancePlan(MaintenancePlan maintenancePlan)
    {
        return maintenancePlanMapper.updateMaintenancePlan(maintenancePlan);
    }

    /**
     * 批量删除维护计划
     * 
     * @param deviceIds 需要删除的维护计划主键
     * @return 结果
     */
    @Override
    public int deleteMaintenancePlanByDeviceIds(Long[] deviceIds)
    {
        return maintenancePlanMapper.deleteMaintenancePlanByDeviceIds(deviceIds);
    }

    /**
     * 删除维护计划信息
     * 
     * @param deviceId 维护计划主键
     * @return 结果
     */
    @Override
    public int deleteMaintenancePlanByDeviceId(Long deviceId)
    {
        return maintenancePlanMapper.deleteMaintenancePlanByDeviceId(deviceId);
    }

    @Override
    public List<MaintenancePlan> selectMaintenancePlanByAreaId(Long areaId) {
        return maintenancePlanMapper.selectMaintenancePlanByAreaId(areaId);
    }

    @Override
    public List<MaintenancePlan> selectMaintenancePlanByMineId(Long mineId) {
        return maintenancePlanMapper.selectMaintenancePlanByMineId(mineId);
    }
}
